<html>
<head><meta charset="utf-8"><title>ready for testing? · t-compiler/wg-rfc-2229 · Zulip Chat Archive</title></head>
<h2>Stream: <a href="https://rust-lang.github.io/zulip_archive/stream/189812-t-compiler/wg-rfc-2229/index.html">t-compiler/wg-rfc-2229</a></h2>
<h3>Topic: <a href="https://rust-lang.github.io/zulip_archive/stream/189812-t-compiler/wg-rfc-2229/topic/ready.20for.20testing.3F.html">ready for testing?</a></h3>

<hr>

<base href="https://rust-lang.zulipchat.com">

<head><link href="https://rust-lang.github.io/zulip_archive/style.css" rel="stylesheet"></head>

<a name="243873865"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/189812-t-compiler/wg-rfc-2229/topic/ready%20for%20testing%3F/near/243873865" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> Eric Huss <a href="https://rust-lang.github.io/zulip_archive/stream/189812-t-compiler/wg-rfc-2229/topic/ready.20for.20testing.3F.html#243873865">(Jun 25 2021 at 04:12)</a>:</h4>
<p>I was wondering if disjoint captures were ready for testing.  I tried migrating a project to 2021, and got this error:</p>
<blockquote>
<p>error: internal compiler error: compiler/rustc_mir_build/src/build/expr/as_place.rs:230:21: No associated capture found for HirId { owner: DefId(0:1124 ~ cargo[2387]::core::compiler::custom_build::build_work), local_id: 953 }[[]] even though capture_disjoint_fields isn't enabled</p>
</blockquote>
<p>If it is not ready, I'll just ignore it.</p>



<a name="243950779"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/189812-t-compiler/wg-rfc-2229/topic/ready%20for%20testing%3F/near/243950779" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> Aman Arora <a href="https://rust-lang.github.io/zulip_archive/stream/189812-t-compiler/wg-rfc-2229/topic/ready.20for.20testing.3F.html#243950779">(Jun 25 2021 at 18:08)</a>:</h4>
<p><span class="user-mention" data-user-id="120518">@Eric Huss</span> the feature is ready for testing. Can you please share what you're trying to migrate and I'll take a look and see why this is breaking</p>



<a name="243950850"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/189812-t-compiler/wg-rfc-2229/topic/ready%20for%20testing%3F/near/243950850" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> Aman Arora <a href="https://rust-lang.github.io/zulip_archive/stream/189812-t-compiler/wg-rfc-2229/topic/ready.20for.20testing.3F.html#243950850">(Jun 25 2021 at 18:09)</a>:</h4>
<p>Though based on the error message, you don't have capture disjoint fields enabled</p>



<a name="243951461"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/189812-t-compiler/wg-rfc-2229/topic/ready%20for%20testing%3F/near/243951461" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> Eric Huss <a href="https://rust-lang.github.io/zulip_archive/stream/189812-t-compiler/wg-rfc-2229/topic/ready.20for.20testing.3F.html#243951461">(Jun 25 2021 at 18:14)</a>:</h4>
<p>Yea, it looks like it needs <code>#![feature(capture_disjoint_fields)]</code> to not ICE.  </p>
<p>Perhaps when <code>--edition=2021</code> is set, it should either be fully enabled (no <code>feature</code> required) or fully disabled (no ICE)?</p>



<a name="243951508"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/189812-t-compiler/wg-rfc-2229/topic/ready%20for%20testing%3F/near/243951508" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> Aman Arora <a href="https://rust-lang.github.io/zulip_archive/stream/189812-t-compiler/wg-rfc-2229/topic/ready.20for.20testing.3F.html#243951508">(Jun 25 2021 at 18:15)</a>:</h4>
<p>Ah I there is a bug yes</p>



<a name="243951556"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/189812-t-compiler/wg-rfc-2229/topic/ready%20for%20testing%3F/near/243951556" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> Aman Arora <a href="https://rust-lang.github.io/zulip_archive/stream/189812-t-compiler/wg-rfc-2229/topic/ready.20for.20testing.3F.html#243951556">(Jun 25 2021 at 18:15)</a>:</h4>
<p>I forgot to make the check edition in MIR</p>



<a name="243951677"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/189812-t-compiler/wg-rfc-2229/topic/ready%20for%20testing%3F/near/243951677" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> Aman Arora <a href="https://rust-lang.github.io/zulip_archive/stream/189812-t-compiler/wg-rfc-2229/topic/ready.20for.20testing.3F.html#243951677">(Jun 25 2021 at 18:17)</a>:</h4>
<p>I'll post a patch, thank you for catching this! Can you post the piece of code (or anything similar) that failed so I can add a test accordingly</p>



<a name="243951717"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/189812-t-compiler/wg-rfc-2229/topic/ready%20for%20testing%3F/near/243951717" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> Aman Arora <a href="https://rust-lang.github.io/zulip_archive/stream/189812-t-compiler/wg-rfc-2229/topic/ready.20for.20testing.3F.html#243951717">(Jun 25 2021 at 18:17)</a>:</h4>
<p><span class="user-mention" data-user-id="116009">@nikomatsakis</span> do we want to move all 2229 tests to edition:2021?</p>



<a name="243952285"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/189812-t-compiler/wg-rfc-2229/topic/ready%20for%20testing%3F/near/243952285" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> Eric Huss <a href="https://rust-lang.github.io/zulip_archive/stream/189812-t-compiler/wg-rfc-2229/topic/ready.20for.20testing.3F.html#243952285">(Jun 25 2021 at 18:22)</a>:</h4>
<p>Yea, it was cargo.  The thing that failed is unfortunately not small.  It is <a href="https://github.com/rust-lang/cargo/blob/36917524b96ebe701b5006b8773042dace8bca05/src/cargo/core/compiler/custom_build.rs#L156-L468"><code>build_work</code></a> which is passing a ton of variables into a closure to be spawned in a thread.</p>
<p>To trigger it, with the latest nightly in the cargo repo, run:</p>
<ol>
<li><code>cargo fix --edition</code></li>
<li>Edit <code>Cargo.toml</code> and add <code>cargo-features = ["edition2021"]</code> at the top and set <code>edition = "2021"</code>.</li>
<li><code>cargo check</code></li>
</ol>



<a name="243967600"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/189812-t-compiler/wg-rfc-2229/topic/ready%20for%20testing%3F/near/243967600" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> nikomatsakis <a href="https://rust-lang.github.io/zulip_archive/stream/189812-t-compiler/wg-rfc-2229/topic/ready.20for.20testing.3F.html#243967600">(Jun 25 2021 at 20:32)</a>:</h4>
<p><span class="user-mention" data-user-id="281950">@Aman Arora</span> yes, let's do that!</p>



<a name="244052949"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/189812-t-compiler/wg-rfc-2229/topic/ready%20for%20testing%3F/near/244052949" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> Aman Arora <a href="https://rust-lang.github.io/zulip_archive/stream/189812-t-compiler/wg-rfc-2229/topic/ready.20for.20testing.3F.html#244052949">(Jun 27 2021 at 06:43)</a>:</h4>
<p>Okay I have a PR up for fixing the missing check and migrating the tests to check for edition: <a href="https://github.com/rust-lang/rust/pull/86661">https://github.com/rust-lang/rust/pull/86661</a></p>



<hr><p>Last updated: Aug 07 2021 at 22:04 UTC</p>
</html>